import { IsNotEmpty, IsString, Length } from 'class-validator'
import { Roles } from '../../role/roles.entity'

export class CreateUserDto {
  @IsString()
  @IsNotEmpty()
  @Length(6, 20, { message: '用户名长度在6-20位之间' })
  username: string

  @IsString()
  @IsNotEmpty()
  @Length(6, 64, { message: '密码长度在6-64位之间' })
  password: string
  roles?: Roles[] | number[]
  email?: string | null
}
